import { createRouter, createWebHistory } from 'vue-router'
import Home from '../View/Home.vue' 
import Test1 from '../View/test1.vue'
import Login from '../View/Login/login.vue'
import Register from '../View/Register/Register.vue'
import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs'
import Manage from '../View/Manage/Manage.vue'
import Individual from '../View/User/individual.vue'
import createUser from '../View/createUser/createUser.vue'
import Shop from '../View/Shop/Shop.vue'
import { ca } from 'element-plus/es/locales.mjs'
import cart from '../View/Shop/Carts/Carts.vue'
import addProduct from '../View/Shop/addProduct/addProduct.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/test1',
    name: 'Test1',
    component: Test1
  },
  {
    path: '/login',
    name: 'Login',
    component:Login
  },
  {
    path: '/register',
    name: 'Register',
    component:Register
  },
  {
    path:'/manage',
    name:'Manage',
    component:Manage
  },
  {
    path:'/individual',
    name:'Individual',
    component:Individual
  },
  {
    path: '/createUser',
    name: 'createUser',
    component:createUser
  },
  {
    path: '/shop',
    name: 'shop',
    component: Shop
  },
  {
    path: '/cart',
    name: 'cart',
    component: cart
    },
    {
    path: '/addProduct',
    name: 'addProduct',
    component: addProduct
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL), // 使用 import.meta.env.BASE_URL
  routes
})

export default router